<template></template>
<script setup lang="ts">
    import { useRoute, useRouter } from 'vue-router';
    import { setBaseLogin } from '/@/enum/pageEnum.ts';
    import { getUserInfo } from '/@/api/user.ts';
    import { useUserStore } from '/@/store/modules/user.ts';

    const route = useRoute();
    const router = useRouter();
    const userStore = useUserStore();
    const { baseLogin, baseHome, msg } = JSON.parse(route.query.data);
    setBaseLogin(baseLogin);
    userStore.setToken(msg);
    getUserInfo().then((res) => {
        const { code, result } = res || {};
        if (code == 200) {
            userStore.setUserInfo(result.userInfo);
            router.push(baseHome);
        }
    });
</script>
<style scoped lang="less"></style>
